package cn.sitedev.prototype;

import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 * @author qchen
 * @description 测试类
 * @date 2020/9/17 20:46
 */
public class DeepCloneTest {
    public static void main(String[] args) throws ParseException {
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        // 创建Human实例
        Human human = new Human("张三", 71, simpleDateFormat.parse("1999-09-09 10:10:10"), new JSONSerializer<>());
        // 获取Human的深克隆对象
        Human humanDeepClone = (Human) human.deepClone();
        humanDeepClone.setBirthday(simpleDateFormat.parse("1999-09-09 20:20:20"));
        System.out.println("human: " + human);
        System.out.println("humanDeepClone: " + humanDeepClone);
    }
}
